<?php
define ( 'ROOT', dirname ( __FILE__ ) );
require_once ROOT . '/lib/base.class.php';
Base::init ( ROOT . '/config.inc.php' );
$_GET ['a'] = $_GET ['a'] ? $_GET ['a'] : 'index';
if ($_GET ['a'] != 'index' || $_GET ['m'] != 'validate') {
	if (! Base::$oBase->User_checkIsLogin_model ()) {
		Base::$oBase->User_login_action ();
		exit ();
	}
	if (! Base::$oBase->User_checkAuth_model ( $_GET ['a'] . '::' . $_GET ['m'] )) {
		Base::showMessage ( '你没有这个权限', './', 'error' );
	}
}
if (is_file ( ROOT . '/' . Base::getConf ( 'base.action_path' ) . '/' . trim ( strtolower ( $_GET ['a'] ) ) . 'action.class.php' )) {
	$sAction = ucfirst ( $_GET ['a'] ) . 'Action';
} else {
	$sAction = 'IndexAction';
}
$sMethod = trim ( $_GET ['m'] );
if ($sMethod == '') {
	$sMethod = 'index';
}
$oAction = Base::loadClass ( $sAction, 'action' );
if (method_exists ( $oAction, $sMethod )) {
	$oAction->$sMethod ();
} elseif (method_exists ( $oAction, 'index' )) {
	$sMethod = 'index';
	$oAction->index ();
} else {
	Base::showMessage ( '错误的请求', './', 'error' );
}
Base::$oBase->Template_output ( $_GET ['a'] . '_' . $sMethod . '.html' );
?>
<img src="./cron.php">